layui.use(["jquery"],function (){
    var $ = layui.jquery;
    $(".layui-btn").click(function () {
        var index = layer.load();
        $.post($("form").attr("action"),$("form").serialize(),function (res){
            layer.close(index)
            if (res &&res["code"]>0) {
                layer.alert(res["msg"]);
                return false;
            } else {
                window.location.href="/index/index";
            }
        },"json")
    })

})
